#!/usr/bin/gnuplot

#esto es para graficar variando la precision de la mantisa

set terminal png
set xrange [1:10]
set xlabel "precision de la mantisa en bits"
set ylabel "error relativo"
set title "Calculo del error relativo en 10 iteraciones"
set output "./varPrec10hasta10.png"
plot "./varPrec10BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varPrec10BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "varPrec10BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL" , "varPrec10BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL"
clear

set terminal png
set xrange [11:48]
set xlabel "precision de la mantisa en bits"
set ylabel "error relativo"
set title "Calculo del error relativo en 10 iteraciones"
set output "./varPrec10hasta48.png"
plot "./varPrec10BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varPrec10BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "varPrec10BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL" , "varPrec10BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL"
clear

set terminal png
set xrange [49:52]
set yrange [0:2e-15]
set xlabel "precision de la mantisa en bits"
set ylabel "error relativo"
set title "Calculo del error relativo en 10 iteraciones"
set output "./varPrec10mas48.png"
plot "./varPrec10BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varPrec10BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "varPrec10BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL" , "varPrec10BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL"
clear

set terminal png
set xrange [1:10]
set autoscale y
set xlabel "precision de la mantisa en bits"
set ylabel "error relativo"
set title "Calculo del error relativo en 50 iteraciones"
set output "./varPrec50hasta10.png"
plot "./varPrec50BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varPrec50BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "varPrec50BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL" , "varPrec50BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL"
clear

set terminal png
set xrange [11:52]
set xlabel "precision de la mantisa en bits"
set ylabel "error relativo"
set title "Calculo del error relativo en 50 iteraciones"
set output "./varPrec50mas10.png"
plot "./varPrec50BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varPrec50BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "varPrec50BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL" , "varPrec50BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL"
clear

set terminal png
set xrange [1:10]
set xlabel "precision de la mantisa en bits"
set ylabel "error relativo"
set title "Calculo del error relativo en 100 iteraciones"
set output "./varPrec100hasta10.png"
plot "./varPrec100BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varPrec100BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "varPrec100BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL" , "varPrec100BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL"
clear

set terminal png
set xrange [11:52]
set xlabel "precision de la mantisa en bits"
set ylabel "error relativo"
set title "Calculo del error relativo en 100 iteraciones"
set output "./varPrec100mas10.png"
plot "./varPrec100BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varPrec100BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "varPrec100BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL" , "varPrec100BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL"
clear

set terminal png
set xrange [1:10]
set xlabel "precision de la mantisa en bits"
set ylabel "error relativo"
set title "Calculo del error relativo en 170 iteraciones"
set output "./varPrec170hasta10.png"
plot "./varPrec170BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varPrec170BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "varPrec170BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL" , "varPrec170BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL"
clear

set terminal png
set xrange [11:52]
set xlabel "precision de la mantisa en bits"
set ylabel "error relativo"
set title "Calculo del error relativo en 170 iteraciones"
set output "./varPrec170mas10.png"
plot "./varPrec170BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varPrec170BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "varPrec170BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL" , "varPrec170BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL"
clear

#esto es para graficar variando la cantidad de terminos

set terminal png
set xrange [0:15]
set xlabel "cantidad de terminos calculados"
set ylabel "error relativo"
set title "Calculo del error relativo con 10 bits de mantisa"
set output "./varTer10hasta15.png"
plot "./varTer10BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "./varTer10BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varTer10BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL" , "./varTer10BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL"
clear

set terminal png
set xrange [16:100]
set xlabel "cantidad de terminos calculados"
set ylabel "error relativo"
set title "Calculo del error relativo con 10 bits de mantisa"
set output "./varTer10mas15.png"
plot "./varTer10BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "./varTer10BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varTer10BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL" , "./varTer10BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL"
clear

set terminal png
set xrange [0:15]
set xlabel "cantidad de terminos calculados"
set ylabel "error relativo"
set title "Calculo del error relativo con 25 bits de mantisa"
set output "./varTer25hasta15.png"
plot "./varTer25BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "./varTer25BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varTer25BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL" , "./varTer25BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL"
clear

set terminal png
set xrange [0:15]
set xlabel "cantidad de terminos calculados"
set ylabel "error relativo"
set title "Calculo del error relativo con 40 bits de mantisa"
set output "./varTer40hasta15.png"
plot "./varTer40BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "./varTer40BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varTer40BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL" , "./varTer40BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL"
clear

set terminal png
set xrange [0:15]
set xlabel "cantidad de terminos calculados"
set ylabel "error relativo"
set title "Calculo del error relativo con 52 bits de mantisa"
set output "./varTer52hasta15.png"
plot "./varTer52BabilonioDOUBLE.txt" with linespoints pointtype 9 title "DOUBLE-BABILONIO" , "./varTer52BabilonioFLOAT.txt" with linespoints pointtype 5 title "FLOAT-BABILONIO" , "./varTer52BinomialDOUBLE.txt" with linespoints pointtype 7 title "DOUBLE-BINOMIAL" , "./varTer52BinomialFLOAT.txt" with linespoints pointtype 3 title "FLOAT-BINOMIAL"
clear
